package ATM;

import Doudizhu.Util2;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Longin extends JPanel implements ActionListener {
    private Icon longin = Util2.Util.getImageIcon("/img/denglu.jpg");
    private Atm frame;  //ATM frame属性
    private JButton loginBtn; //登陆按钮


    public Longin(Atm frame) {

        this.frame = frame;

        this.setLayout(null); //空布局
        this.setOpaque(false); //背景透明
        loginBtn= new JButton(longin); //登陆按钮
        loginBtn.setBounds(400, 500, 120, 50);
        this.add(loginBtn);
        loginBtn.addActionListener(this);


    }
    @Override
    public void actionPerformed(ActionEvent e) {
        if(e.getSource() == loginBtn){
            frame.switchPanel("菜单");
        }

    }
}
